package proxy.extend;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class IntermediaryInvocationHandler implements InvocationHandler {
    private Object target;

    public IntermediaryInvocationHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("前期准备");
        System.out.println("查找房源");
        System.out.println("和买家沟通时间");
        Object feedback=method.invoke(target,args);
        System.out.println("后期跟踪");
        System.out.println("和买家沟通意见");
        return feedback;
    }
}
